import QtQuick 2.6

import "../../Base/Config"
import Code 1.0

import "../../FallView" as FallView
import "../../Evaluation/Multi/Post" as EVPost

FallView.FallView {
    z: -1

    delegate: EVPost.Post {
        width: parent.width
        name: model.username
        headSource: model.head
        subject: model.subject
        time: model.postTime
        province: model.province
        city: model.city
        imageCount: model.imageCount ? model.imageCount : 0
        imageSource: model.image ? model.image : ""
        audioSource: model.audio ? model.audio : ""
        comment: model.comment
        type: model.type
        Component.onCompleted: {
            Helper.printObject(model, "model")
        }
    }
    model: ListModel {
        id: listmodel
    }

    Component.onCompleted: {
        listmodel.append({
                             type: "钢琴  ",
                             username: "欢乐的0403",
                             head: "../../../resources/tests/touxiang02.svg",
                             subject: Subject.Music,
                             postTime: new Date(),
                             province: qsTr("广西"),
                             city: qsTr("来宾"),
                             audio: "../../../resources/tests/钢琴曲 - Summer.mp3",
                             imageCount: 0,
                             image: "",
                             comment: "1st"
                         })
        listmodel.append({
                             type: "就是画画  ",
                             username: "欢乐的0403",
                             head: "../../../resources/tests/touxiang02.svg",
                             subject: Subject.Paint,
                             postTime: new Date(),
                             province: ("广西  "),
                             city: ("来宾  "),
                             audio: "",
                             imageCount: 1,
                             image: "../../../resources/tests/121025539394.jpg",
                             comment: "2nd"
                         })
        listmodel.append({
                             type: "就是画画  ",
                             username: "欢乐的0403",
                             head: "../../../resources/tests/touxiang02.svg",
                             subject: Subject.Paint,
                             postTime: new Date(),
                             province: qsTr("广西"),
                             city: qsTr("来宾"),
                             imageCount: 1,
                             image: "../../../resources/tests/121025539394.jpg",
                             comment: "3rd"
                         })
    }
}
